export const globalEvent = {};

globalEvent.events = {};
globalEvent.$emit = function (eventName) {
  const func = globalEvent.events[eventName];
  if (!func) globalEvent.events[eventName] = function (callback) {
    callback();
  } 
}

globalEvent.$on = function (eventName, callback) {
  const func = globalEvent.events[eventName];
  if (!func) globalEvent.events[eventName] = function (callback) {
    callback();
  } 
  globalEvent.events[eventName](callback);
}